package com.azthink.chaper411.component;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestMain {
    public static void main(String[] args) {
        // @Configuration注解的spring容器加载方式，用AnnotationConfigApplicationContext替换ClassPathXmlApplicationContext
        ApplicationContext context = new AnnotationConfigApplicationContext(TestConfiguration.class);

//        TestBean tb = (TestBean) context.getBean("testBean");
//        tb.sayHello();

        /*TestDao td = (TestDao) context.getBean("aaDao");
        td.printInfo();*/

        TestService ts = (TestService)context.getBean("testService");
        ts.printInfo();
    }
}
